<?php
class Studyinterest extends AppModel {
	var $name = 'Studyinterest';
	
	//ACL this is a crontrolled object ACO
	var $actsAs = array('Acl' => array('type' => 'controlled'));
	
	function parentNode() {
		if (!$this->id && empty($this->data)) {
			return null;
		}
		if (isset($this->data['Studyinterest']['application_id'])) {
			$appId = $this->data['Studyinterest']['application_id'];
		} else {
			$appId = $this->field('application_id');
		}
		if (!$appId) {
			return null;
		} else {
			return array('Application' => array('id' => $appId));
		}
	}
	
	var $validate = array(
		'career_goals' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'A statement of career goals is required.'
			)
		)
	);
	
/**
* START ASSOCIATION INFORMATION
******************************************************************************
*/

	var $belongsTo = array(
		'Application' => array(
			'className' => 'Application',
			'foreignKey' => 'application_id'
		)
	);
	
}